using System;
using System.Collections.Generic;
using System.Text;

namespace Acms.Bll
{
    public abstract class BaseItem
    {
        private bool _isDirty = true;
        protected bool IsDirty
        {
            get
            {
                return _isDirty;
            }
        }

        private bool _IsDeleted = false;
        protected bool IsDeleted
        {
            get
            {
                return _IsDeleted;
            }
        }

        protected virtual void AcceptChanges()
        {
            _isDirty = false;
        }

        protected virtual void SetChanged(Enum field, object oldValue, object newValue)
        {
            _isDirty = true;
        }

        public abstract bool SaveChanges();

        public void Delete()
        {
            _IsDeleted = true;
        }

    }
}
